package com.itany.corejava.day07;

public class Test5 {
    public static void main(String[] args) {
//        B b=new B();
//        b.setI(3);
//        System.out.println("b.getI() = " + b.getI());

        A a=new A();
        f(a);

        B b=new B();
        f(b);

        A ab=new B();
        f(ab);

    }

    public static void f(A a){
        System.out.println("a");
    }
    public static void f(B b){
        System.out.println("b");
    }
}


class A{
    public int i=1;
    
    public int getI(){
        return i;
    }
}
class B extends A{
    private int i=2;

    public void setI(int i){
//        this.i=i;
        super.i=i;
    }
}
